# Contributor: Sean McAvoy <seanmcavoy@gmail.com>
# Maintainer: Sean McAvoy <seanmcavoy@gmail.com>
pkgname=py3-subprocess-tee
pkgver=0.4.1
pkgrel=1
pkgdesc="subprocess.run drop-in replacement that supports a tee mode"
url="https://github.com/pycontribs/subprocess-tee"
arch="noarch"
license="MIT"
depends="python3 py3-enrich"
makedepends="py3-setuptools py3-setuptools_scm py3-gpep517 py3-installer py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/s/subprocess-tee/subprocess-tee-$pkgver.tar.gz"
builddir="$srcdir/subprocess-tee-$pkgver"

case "$CARCH" in
s390x) options="$options !check" ;;
esac

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear test-env --system-site-packages
	test-env/bin/python3 -m installer .dist/subprocess_tee*.whl
	test-env/bin/python3 -m pytest -k 'not test_molecule and not test_rich_console_ex'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/subprocess_tee*.whl
}

sha512sums="
683813096c4bb78a4263075ba8590a926134ec92db5e2e72ed98ab1db9e231768adc15bb4273ba138f9a1b2a14ae4050d0b6acc76d483d0f3530f376ce8d9eee  subprocess-tee-0.4.1.tar.gz
"
